// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import 'assets/lib/bridge/bridge.js'
import '@/assets/css/common.less'
import loopPlugin from '@/plugin/loop'
import { Loop } from '@/common/polling'

import loading from '@/components/common/Loading'
import error from '@/components/common/Error'

// 注册全局组件
Vue.component('loading', loading);
Vue.component('error', error);

Vue.config.productionTip = false

Vue.use(loopPlugin);

router.beforeEach((to, from, next) => {
  Loop.getInstance().clear();
  next();
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
